In some modern database systems, such as the HANA in-memory database (IMDB) by SAP AG of Walldorf Germany, a function in an external library is either a C-style function, or a method of a C++ class. In the first case, a symbol address of the function must be determined and cast to an appropriate function pointer. Then, the function pointer must be filled with the function parameters, after which the function pointer can be executed. In the second case, the C++ class must be instantiated to run the function.
In the former case, it is impossible to have all kinds of function pointers defined in the kernel coding to cover all possible parameters, and restricting application functions to a limited set of signatures is not desirable. In the latter case, the class is not known in the kernel coding. Accordingly, what is needed is a solution to make an existing IMDB kernel aware of new external function libraries.
As functions are contained in C++ libraries, it is not just an SQL-like “create procedure . . . as . . . ” statement that needs to be executed for registering the functions as database procedures in the database catalog if the function is supposed to be called as procedure. However, a detailed description of the parameters needs to be transferred to the database catalog. Using one example, describing an ABAP structure or table parameter is different than just specifying an int parameter. For example, the alignment of the members within a structure or table has to be known, and may be platform dependent. So, the task of specifying detailed parameter descriptions cannot be done by application logic developers.
Another problem with external function libraries is that to access their functions, the library must be loaded. Managing who controls the loading of the library, keeping track of symbols being used for the functions and/or library, and managing how and when a library may be unloaded are critical considerations. For example, attempting to access a symbol in a library after that library is unloaded will lead to a crash of the index server of the IMDB, even if the library is later reloaded. Implementing a library management mechanism for each kind of library is infeasible and in most cases impossible, as libraries are developed independent of the kernel.